using QFramework.Adventure;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace QFramework.Adventure
{
    public class SaveItemController : InteractionBase, IInteraction,IController,IIsDone
    {
        public bool isDone { get; set ; }
        public GameObject SelfObj { get; set ; }

    
        private void Start()
        {
            gameObject.SetActive(!isDone);
            SelfObj = gameObject;
        }
  
        public void ExitAction()
        {       
            UIKit.ClosePanel<TipPanel>();
        }

        public void TriggerAction()
        {
         
            UIKit.OpenPanel<TipPanel>(new TipPanelData() { content01 = _content, action = ()=> 
            {
             
                isDone = true;
                gameObject.SetActive(!isDone);
                this.GetUtility<IStorage>().SaveData();
            } });
      
        }

        public IArchitecture GetArchitecture()
        {
            return AdventureApp.Interface;
        }
    }
}